home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2005 May / CyberMycha 05-2005 (Poland).bin / Immortal / cotndemo.exe / Data1.cab / groundshadowcombine.vsh < prev    next >
Encoding:
Text File  |  2004-11-16  |  688 b   |  23 lines

  1. // vertex shader to combine ground shadow texture with model drawing (ground shadows only)
  2.  
  3. vs_1_1                // version
  4. dcl_position v0        // position
  5. dcl_normal v3        // normal
  6. dcl_color v6        // vertex color
  7. dcl_texcoord v7        // texture coordinates
  8.  
  9. m4x4 r0, v0, c0        // transform by matrix at c0 to get position for rendering
  10. mov oPos,r0
  11.  
  12. // oFog = (fogend - dist) / (fogend-fogstart)
  13. sub r1.x,c7.x,r0.w    
  14. mul oFog,r1.x,c7.y    
  15.  
  16. mov oT0,v7            // move the texture coordinate to output
  17.  
  18. mov r0,v3            // normal isnt normal, it's used for shadow buffer projection coordinates
  19. mov oT1,r0            // store in texture coords for stage 1
  20.  
  21. mov oD0,v6            // pass the color along to the pixel shader
  22.  
  23.